<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
      function Animal(name,age){
       this.name=name;
        this.age=age;
    }
      var a=new Animal('cat',3);
    function Person(name,age){
    this.name=name;
    this.age=age;
    }
      var p=new Person('zhangsan',20);
    function Student(id){
    this.id=id;
    }
      var s=new Student(4);
  Animal.prototype.weight=90;
    Person.prototype=a;
  Student.prototype=p;
    console.log(p.name);
    console.log(s.id);

</script>
</body>
</html>